package testing.plagiarism;

import static org.junit.Assert.assertEquals;

import java.util.ArrayList;

import org.junit.Before;
import org.junit.Test;

import plagiarism.CheckManager;

import seperator.AWLSeperator;


public class CheckManagerTest {
	CheckManager checkmanager;
	@Before
	public void setUp() throws Exception {
		this.checkmanager = new CheckManager();
		
	}
	
	@Test
	public void test1()
	{
		String []datalist1 = {"Tom","Cruise","is","100","cm","high","."};
		String []datalist2 = {"He","is","Tom","Cruise","."};
		ArrayList<String[]> list = new ArrayList<String[]>();
		list.add(datalist1);
		list.add(datalist2);
		checkmanager.operation(list);
		checkmanager.checking();
		boolean result = false;
		if(checkmanager.getArtResult(0)!= null)
		{
			result = true;
		}
		assertEquals(result,true);
	}
	@Test
	public void test2()
	{
		String []datalist1 = {"Tom","Cruise","is","100","cm","high","."};
		String []datalist2 = {"He","is","Tom","Cruise","."};
		ArrayList<String[]> list = new ArrayList<String[]>();
		list.add(datalist1);
		list.add(datalist2);
		checkmanager.operation(list);
		checkmanager.checking();
		int result = checkmanager.output_all().size();

		assertEquals(result,2);
	}
	@Test
	public void test3()
	{
		checkmanager.checking();
		int result = checkmanager.output_all().size();
		assertEquals(result,0);
	}
}
